<template>
  <el-row class="tac">
    <el-col>
      <el-menu :default-active="defaultActive" class="el-menu-vertical-demo" @select="checkMethod">
        <el-submenu index="task">
          <template slot="title">
            <i class="el-icon-setting"></i>
            <span>任务管理</span>
          </template>
          <el-submenu index="`task-${$tIdx}`">
            <template slot="title">{{'$tVal.name'}}</template>
            <el-menu-item key="$cIdx" index="`${$tVal.id}-${$cVal.id}-${$tIdx}-${$cIdx}`">
              <span>{{'$cVal.name'}}</span>
            </el-menu-item>
          </el-submenu>
          <el-menu-item index="1-1">选项1</el-menu-item>
          <el-menu-item index="1-2">选项2</el-menu-item>
        </el-submenu>
      </el-menu>
    </el-col>
  </el-row>
</template>
<script>
import apis from "@utils/apis";
export default {
  data() {
    return {
      defaultActive: 'task_list',
      artist: [],
      menulist: [],
    }
  },

  mounted() {
    this.$nextTick(function() {
      this.defaultActive = this.$route.name || 'task_list'
    })
  },

  methods: {
    checkMethod(name, keyPath) {
      let params = {}
      let nArr = name.split('-')
      if (/^api-/.test(name)) {
        let type = params.type = nArr[1]
        params.source = nArr[2]
        name = 'artist_task'
      } else {
        name = 'task_list'
        params.typeId = nArr[0]
        params.cateId = nArr[1]
      }
      this.$router.push({
        name,
        params,
      })
    }
  },

}

</script>
<style>


</style>
